﻿using System.Data;
using System.Reflection;
using Exceptionless;
using Infrastructure.Centers;
using Infrastructure.Extensions;
using Microsoft.AspNetCore.Builder;
using Microsoft.AspNetCore.Hosting;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Options;
using Microsoft.OpenApi.Models;
using Oracle.ManagedDataAccess.Client;
using SqlSugar.IOC;

namespace Infrastructure
{
  
public class AppConfig
{
    public ApolloConfig Apollo { get; set; } = new();
    public DockerConfig Docker { get; set; } = new();
    public RedisConfig Redis { get; set; } = new();
    public ServiceCenterConfig ServiceCenter { get; set; } = new();
    public FileCenterConfig FileCenter { get; set; } = new();
    public ExceptionlessConfig Exceptionless { get; set; } = new();
    public DatabaseConfig Database { get; set; } = new();

    public class ApolloConfig
    {
        public string AppId { get; set; } = string.Empty;
    }

    public class DockerConfig
    {
        public string LocalIP { get; set; } = string.Empty;
        public int LocalPort { get; set; }
        public Dictionary<string, string> ConstService { get; set; } = new();
    }

    public class RedisConfig
    {
        public string Url { get; set; } = string.Empty;
        public string Prefix { get; set; } = string.Empty;
    }

    public class ServiceCenterConfig
    {
        public string Url { get; set; } = string.Empty;
    }

    public class FileCenterConfig
    {
        public string Url { get; set; } = string.Empty;
        public int MaxSizeMBPerFile { get; set; } = 50;
    }

    public class ExceptionlessConfig
    {
        public string ServerUrl { get; set; } = string.Empty;
        public string ApiKey { get; set; } = string.Empty;
    }

    public class DatabaseConfig
    {
        public string MesConnection { get; set; } = string.Empty;
    }
}

}